package com.wtpm.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fwk.spbt.controller.BaseController;
import com.fwk.spbt.vo.RequestIdsStateVO;
import com.fwk.spbt.vo.RequestPageVO;
import com.fwk.spbt.vo.ResponeVO;
import com.fwk.spbt.vo.ResponsePageVO;
import com.wtpm.sys.service.IUserService;
import com.wtpm.sys.vo.SysUserVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = { "sys->用户维护" })
@RestController
@RequestMapping("/sys/user")
public class UserController extends BaseController {

	@Autowired
	private IUserService userService;

	@ApiOperation(value = "新增用户")
	@RequestMapping(value = "/addUser", method = { RequestMethod.POST })
	public ResponeVO<String> addUser(@RequestBody SysUserVO reqDTO) {
		userService.addUser(reqDTO);

		return response();
	}

	@ApiOperation(value = "修改用户")
	@RequestMapping(value = "/updateUser", method = { RequestMethod.POST })
	public ResponeVO<String> update(@RequestBody SysUserVO reqDTO) {
		// userService.update(reqDTO);
		return response();
	}

	@ApiOperation(value = "批量修改用户状态")
	@RequestMapping(value = "/updateUserState", method = { RequestMethod.POST })
	public ResponeVO<String> state(@RequestBody RequestIdsStateVO reqDTO) {
		return response();
	}

	@ApiOperation(value = "分页查找")
	@RequestMapping(value = "/pagingUser", method = { RequestMethod.POST })
	public ResponeVO<ResponsePageVO<SysUserVO>> paging(@RequestBody RequestPageVO<SysUserVO> reqDTO) {
		ResponsePageVO<SysUserVO> page = userService.queryUserpage(reqDTO);
		return response(page);
	}

}
